﻿

<#include "/code/front/include/head.ftl" />

<#assign  tid = ctx.paramAsInt('tid',0) />
<#assign  cid = ctx.paramAsInt('cid',0) />
<#assign  sw = ctx.param('sw','') />

<#assign blogCates = dq.getDataByName('博客分类')![] />
<#assign blogTags = dq.getDataByName('博客标签')![] />

<#assign qs = [{'limit':10}] />
<#if tid!= 0>
    <#assign qs =  [{'limit':10},{'field':'tag_ids','query_type':'fis','value':[tid]}] />
</#if>
<#if cid!= 0>
    <#assign qs = [{'limit':10},{'field':'cate_ids','query_type':'fis','value':[cid]}] />
</#if>
<#if sw !=''>
    <#assign qs = [
           {'limit':10},
           {'field':'title','query_type':'like','value':[sw]}
<#--           {'field':'introduction','query_type':'like','value':[sw]},-->
<#--           {'field':'detail', 'value':[sw]}-->
    ] />
</#if>
<#assign blogs = dq.getDataByName('博客文章', qs )![] />

    <main class="main-workdetails-page">

        <#include "/code/front/include/header.ftl">

        <!-- Breadcrumb -->
<#--        <section class="breadcrumb-area">-->
<#--            <div class="container">-->
<#--                <div class="breadcrumb-content" data-aos="fade-up">-->
<#--                    <p>首页 - 博客</p>-->
<#--                    <h1 class="section-heading"><img src="assets/images/star-2.png" alt="Star"> 博客列表 <img src="assets/images/star-2.png" alt="Star"></h1>-->
<#--                </div>-->
<#--            </div>-->
<#--        </section>-->


        <!-- Blog Items -->
        <section class="breadcrumb-area">
            <div class="container">
                <div class="breadcrumb-content" data-aos="fade-up">
                    <p>首页 - 博客</p>
                </div>
                <div class="row">
                    <div class="col-md-8">
                        <div class="blog-items">
                            <#if  blogs?size == 0>
                                <h2 style="text-align:center;">暂无数据</h2>
                            </#if>
                            <#list blogs as b>
                                <div class="blog-item" data-aos="zoom-in">
                                    <div class="img-box">
                                        <img src="${b.cover!}" alt="${b.title!}">
                                    </div>
                                    <div class="content">
                                        <span class="meta">${DateKit.getTimeDescription(b.create_time)!} - 评论 (${b.comment_num!'0'}) - 分享 (${b.share_num!'0'})</span>
                                        <h1><a href="/blog-details?id=${b.data_id!}">${b.title!}</a></h1>
                                        <p>${b.introduction!}</p>
                                        <a href="/blog-details?id=${b.data_id!}" class="theme-btn">博客详情</a>
                                    </div>
                                </div>
                            </#list>
                            
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="blog-sidebar">
                            <div class="blog-sidebar-inner">

                                <div class="blog-sidebar-widget search-widget">
                                    <div class="blog-sidebar-widget-inner" data-aos="zoom-in">
                                        <form class="shadow-box">
                                            <input type="text" name="sw" placeholder="输入关键字进行搜索...">
                                            <button class="theme-btn">搜索</button>
                                        </form>
                                    </div>
                                </div>

                                <div class="blog-sidebar-widget recent-post-widget" data-aos="zoom-in">
                                    <div class="blog-sidebar-widget-inner shadow-box">
                                        <h3>最新博客</h3>
                                        <ul>
                                            <#list blogs as b>
                                            <li><a href="/blog-details?id=${b.data_id!}">${b.title!}</a></li>
                                            </#list>
                                        </ul>

                                    </div>
                                </div>

                                <div class="blog-sidebar-widget categories-widget" data-aos="zoom-in">
                                    <div class="blog-sidebar-widget-inner shadow-box">
                                        <h3>博客分类</h3>

                                        <ul>
                                            <#list blogCates as ca>
                                                <li><a href="/blog?cid=${ca.data_id!}">-${ca.name!}</a></li>
                                            </#list>
                                        </ul>

                                    </div>
                                </div>

                                <div class="blog-sidebar-widget tags-widget" data-aos="zoom-in">
                                    <div class="blog-sidebar-widget-inner shadow-box">
                                        <h3>博客标签</h3>

                                        <ul>
                                            <#list blogTags as ts>
                                            <li><a class="theme-btn" href="/blog?tid=${ts.data_id!}">${ts.name!}</a></li>
                                            </#list>
                                        </ul>

                                    </div>
                                </div>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>





        <#include "/code/front/include/footer.ftl" />

    </main>
    


</body>
</html>
